package org.raymond.iworks.study.netty.demo.echo;

import io.netty.bootstrap.Bootstrap;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioDatagramChannel;

/**
 * @author raymond
 * @version V1.0
 * @Description: TODO
 */
public class EchoServer {
    public static void main(String[] args) throws InterruptedException {
        Bootstrap b = new Bootstrap();
        EventLoopGroup group = new NioEventLoopGroup();
        b.group(group)
                .channel(NioDatagramChannel.class)
                .handler(new EchoServerHandler())
        ;

        // 监听13001端口
        b.bind(13001).sync().channel().closeFuture().await();
    }
}
